{% extends "base.html" %}
{% block title %}实时Streaming任务{% endblock %}
{% block headpre %}
{% endblock %}
{% block head %}
{% endblock %}
{% block contentheader %}实时任务{% endblock %}
{% block contentsmallheader %}spark streaming任务 <a href="http://172.19.100.12:7180/cmf/services/8/status"><i class="fa fa-share"></i></a>{% endblock %}
{% block content %}
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title fa fa-tv"> 已提交的Streaming任务(user:dp | pool:streaming)</h3>

                    <div class="box-tools">
                        <button type="button" class="btn btn-box-tool" id="list_error">error
                        </button>
                        <button type="button" class="btn btn-box-tool" id="list_all">all
                        </button>
                        <button type="button" class="btn btn-box-tool " data-widget="collapse"><i
                                class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <div class="box-body no-padding" style="display: block;">
                    <ul class="nav nav-pills nav-stacked" id="task_list" style="overflow: auto;max-height: 700px">
                    </ul>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
{% block script %}
    <script>
        function add_class() {
            $('#treeview4').addClass('active');
            $('#menu4').addClass('menu-open');
            $('#monitorstreaming').addClass('active');
        }
        {#        $("#task_detail").hide();#}
        {#        $('#list_error').on('click', function () {#}
        {#            $('.t_ok').hide();#}
        {#        });#}
        {#        $('#list_all').on('click', function () {#}
        {#            $('.t_ok').show();#}
        {#        });#}
        $.ajax({
            url: '/monitor_streaming_result',
            success: function (result) {
                var a_list = result.list;
                for (var key in a_list) {
                    $("#task_list").append("<li class='t_ok' data-target=''><a><i class='fa fa-tasks'></i> " + key + "<span class='label label-primary pull-right'>" + a_list[key][0] + " | " + a_list[key][1] + " | " + a_list[key][2] + " </span></a></li>");
                }
            }
        })
    </script>
{% endblock %}